package javacode.chapter06.多态;

public class Demo {

    public static void personWork(Person p){
        p.work();
    }

    public static void main(String[] args) {
        Person p1=new Student();
        personWork(p1);

        Person p2=new Teacher();
        personWork(p2);
    }
}
